<?php
    require_once('misc.php');
    $xml = file_get_contents('http://localhost/~cleric/posod/XML/publish.php?userid=1');

    $posts = xml2posts($xml);
?>
<!DOCUMENT html>
<html>
    <head>
        <meta charset="utf-8">
        <link rel="stylesheet" type="text/css" href="style.css">
        <title>Wall</title>
    </head>
    <body>
        <div class="container">
        <?  foreach($posts as $i => $post) { ?>
            <div class="post">
                <div class="<?=($i%2) ? 'titleleft' : 'titleright'?>">
                    <span class="user"><?=$post['user']?></span>
                    <span class="date"><?=$post['date']?></span>
                </div>
                <div class="message">
                    <?=$post['message']?>
                </div>
            </div>
        <? } ?>
        </div>
    </body>
</html>
